package ysu.sxm.ptjc.Dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import ysu.sxm.ptjc.Domin.RecordList;
import ysu.sxm.ptjc.pojo.*;

import java.sql.Date;
import java.util.List;

@Repository
@Mapper
public interface RecordStatisticalMapper {
    /*
    CastingDefectsInfo getCastingDefectsInfoBydate(String producenum,String begintime, String endtime);
    ExtrusionDefectInfo getExtrusionDefectInfoBydate(String producenum,String begintime, String endtime);
    MachiningDefectsInfo getMachiningDefectsInfoBydate(String producenum,String begintime, String endtime);
    PolishingDefectInfo getPolishingDefectInfoBydate(String producenum,String begintime, String endtime);
    OxidationDefectInfo getOxidationDefectInfoBydate(String producenum,String begintime, String endtime);
    AssemblyDefectInfo getAssemblyDefectInfoBydate(String producenum,String begintime, String endtime);
    CdpDefectInfo getCdpDefectInfoBydate(String producenum,String begintime, String endtime);
    */

    CastingDefectsInfo getCastingDefectsInfo(String defect_degree,String producenum,String date);
    ExtrusionDefectInfo getExtrusionDefectInfo(String defect_degree,String producenum,String date);
    MachiningDefectsInfo getMachiningDefectsInfo(String defect_degree,String producenum,String date);
    PolishingDefectInfo getPolishingDefectInfo(String defect_degree,String producenum,String date);
    OxidationDefectInfo getOxidationDefectInfo(String defect_degree,String producenum,String date);
    AssemblyDefectInfo getAssemblyDefectInfo(String producenum,String date);
    CdpDefectInfo getCdpDefectInfo(String producenum,String date);



    int insertCastingDefectsInfo(CastingDefectsInfo castingDefectsInfo);
    int insertExtrusionDefectInfo(ExtrusionDefectInfo extrusionDefectInfo);
    int insertMachiningDefectsInfo(MachiningDefectsInfo machiningDefectsInfo);
    int insertPolishingDefectInfo(PolishingDefectInfo polishingDefectInfo);
    int insertOxidationDefectInfo(OxidationDefectInfo oxidationDefectInfo);
    int insertAssemblyDefectInfo(AssemblyDefectInfo assemblyDefectInfo);
    int insertCdpDefectInfo(CdpDefectInfo cdpDefectInfo);


    //根据日期获得num列表
    List<String> getProduceNumByDate(String date);


    //根据日期获取defect_record_info表进而获取id
    List<DefectRecordInfo> getDefectRecordInfoByDate(String date);
    //根据defect_record_info 的id获取produce_info表进而获取num
    List<ProduceInfo>getProduceInfoById(@Param("defectRecordInfo") List<DefectRecordInfo> defectRecordInfo);
    //获取当天某种缺陷的数量
    int getCountDefectNum(@Param("defect_num") String defect_num,@Param("date") String date);


    List<ProduceInfo> getProduceTypeAndLineIdByProduceNumAndLineId(@Param("num")String num);

    int getAllCountByproduceNum(String num,String date);
    int getDefectCount(String degree,String num,String date);
    int insertAccount(AccountInfo accountInfo);
}
